package cn.iocoder.yudao.module.book.dal.mysql.fine;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.book.dal.dataobject.fine.FineDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.book.controller.admin.fine.vo.*;

/**
 * 逾期罚金 Mapper
 *
 *
 */
@Mapper
public interface FineMapper extends BaseMapperX<FineDO> {

    default PageResult<FineDO> selectPage(FinePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FineDO>()
                .eqIfPresent(FineDO::getLoanId, reqVO.getLoanId())
                .eqIfPresent(FineDO::getAmount, reqVO.getAmount())
                .eqIfPresent(FineDO::getPaid, reqVO.getPaid())
                .betweenIfPresent(FineDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FineDO::getId));
    }

}